<!DOCTYPE html>
<html>

<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <!-- 对不识别viewport设备优化 -->
    <meta name="HandheldFriendly" content="true">
    <!-- windows phone 点击无高光 -->
    <meta name="msapplication-tap-highlight" content="no">
    <title>商圈认购 | 商超财富宝</title>
    <link rel="icon" type="image/x-icon" href="./favicon.ico" />
    <style>
        header {
            position: fixed;
            top: 0;
            width: 100%;
            height: 88px;
            line-height: 88px;
            text-align: center;
            color: #fff;
            background-color: #f5445d;
        }
    </style>
</head>

<body>
   <header>商圈认购</header>
    <input type="text" class="name">
    <input type="tel" class="tel">
    <input type="text" class="area">
    <input type="text" class="tradeArea">
    <input type="text" class="tradeAreaId">

    <input type="submit" value="提交">
</body>
<script src="./jquery1.7.2.js"></script>
<script>
    // 获取url中code值
    function getUrlParams(name) {
        var search = document.location.search
        var pattern = new RegExp('[?&]' + name + '\=([^&]+)', 'g')
        var matcher = pattern.exec(search)
        var items = null
        if (null != matcher) {
            try {
                items = decodeURIComponent(decodeURIComponent(matcher[1]))
            } catch (e) {
                try {
                    items = decodeURIComponent(matcher[1])
                } catch (e) {
                    items = matcher[1]
                }
            }
        }
        return items
    }
    $(function () {
        var id = getUrlParams("id");
       var tradeArea = getUrlParams("tradeArea");
       $(".tradeAreaId").val(id);
       $(".tradeArea").val(tradeArea);
    })
</script>

</html>